package com.example.adapter;

import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.domain.Food;
import com.example.mypro.R;

public class Fd_LvAdapter extends BaseAdapter{
     private List<Food> list;
     private Context context;

public Fd_LvAdapter(List<Food> list, Context context) {
	this.list = list;
	this.context = context;
}

@Override
public int getCount() {
	return list.size();
}

@Override
public Object getItem(int arg0) {
	return list.get(arg0);
}

@Override
public long getItemId(int arg0) {
	return arg0;
}

@Override
public View getView(int arg0, View arg1, ViewGroup arg2) {
	View view = LayoutInflater.from(context).inflate(R.layout.xw_lv_item,
			null);
	TextView textView = (TextView) view.findViewById(R.id.xw_lv_title);
	textView.setText(list.get(arg0).getname());
	return view;
}
}